import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';

import {TodoComponent} from './todo/todo-main/todo-main.component';
import {AuthGuard} from './auth/auth-guard';
import {AuthLoginComponent} from './auth/auth-login/auth-login.component';
import {AuthRegistrationComponent} from './auth/auth-registration/auth-registration.component';

const routes: Routes = [
    {
        path: '',
        redirectTo: 'todo',
        pathMatch: 'full'
    },
    {
        path: 'todo',
        component: TodoComponent,
        canActivate: [AuthGuard],
        children: []
    }
];

@NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
})
export class AppRoutingModule {
}
